#pragma once
#include <stdio.h>
#include <string.h>
#include "SeqQueue.h"
#include "SeqStack.h"
//****************判断两个字符串是否按照出栈顺序****************

int IsStackOrder(char input[],int64_t in_size,char output[],int64_t out_size);


//*******************实现最小栈的方法一***************
typedef char MinStackType;

typedef struct MinStack
{
    SeqStack date;
    SeqStack min;
}MinStack;

//打印最小栈中的内容
void PrintMinStack(MinStack *minstack,const char *msg);
//最小栈的初始化
void MinStackInit(MinStack *minstack);
//最小栈的入栈操作
void MinStackPush(MinStack *minstack,MinStackType value);
//最小栈的出栈操作
void MinStackPop(MinStack *minstack);
//最小栈的取栈顶元素
int MinStackTop(MinStack *minstack ,MinStackType *tmp);
//最小栈的销毁
void MinStackDestroy(MinStack *minstack);
//******************实现最小栈的方法二*******************
//打印最小栈
void PrintMinStack_1(SeqStack *minstack,const char *msg);
//最小栈的初始化
void MinStackInit_1(SeqStack *minstack);
//最小栈的入栈
void  MinStackPush_1(SeqStack *minstack,MinStackType value);
//最小栈的出栈操作
void MinStackPop_1(SeqStack *minstack);
//最小栈的取栈顶元素
int MinStackTop_1(SeqStack *minstack,MinStackType *tmp);
//最小栈的销毁
void MinStackDestroy_1(SeqStack *minstack);
//****************两个栈实现一个队列***********************
typedef char QueueType;

typedef struct Queue
{
    SeqStack  Spush;
    SeqStack  Spop;
}Queue;
//打印队列的内容
void PrintQueue(Queue *queue,const char *msg);
//队列的初始化
void QueueInit(Queue *queue);
//入队列操作
void QueuePush(Queue *queue,QueueType value);
//出队列操作
void QueuePop(Queue *queue);
//取队首元素
int QueueFront(Queue *queue,QueueType *tmp);
//销毁一个队列
void QueueDestroy(Queue *queue);
//*****************两个队列实现一个栈***************************
typedef char StackType;
typedef struct Stack
{
    SeqQueue q1;
    SeqQueue q2;
}Stack;
//打印栈中的内容
void PrintStack(Stack *stack,const char *msg);
//栈的初始化
void StackInit(Stack *stack);
//入栈操作
void StackPush(Stack *stack,StackType value);
//出栈操作
void StackPop(Stack *stack);
//取栈顶元素
int StackTop(Stack *stack,StackType *tmp);
//销毁栈
void StackDestroy(Stack *stack);
//****************实现一个共享栈********************************
typedef char ShareStackType;
#define ShareStackSize 1000
typedef struct ShareStack
{
    ShareStackType data[ShareStackSize];
    size_t top1;
    size_t top2;
}ShareStack;
//打印栈一中的内容
void PrintShareStack_1(ShareStack *share,const char *mas);
//打印栈二中的内容
void PrintShareStack_2(ShareStack *share,const char *msg);
//共享栈的初始化
void ShareStackInit(ShareStack *share);
//栈一的入栈
void ShareStackPush_1(ShareStack *share,ShareStackType value);
//栈二的入栈
void ShareStackPush_2(ShareStack *share,ShareStackType value);
//栈一的出栈
void ShareStackPop_1(ShareStack *share);
//栈二的出栈
void ShareStackPop_2(ShareStack *share);
//取栈一的栈顶元素
int ShareStackTop_1(ShareStack *share,ShareStackType *tmp);
//取栈二的栈顶元素
int ShareStackTop_2(ShareStack *share,ShareStackType *tmp);
//销毁栈一
void ShareStackDestroy_1(ShareStack *share);
//销毁栈二
void ShareStackDestroy_2(ShareStack *share);



